package net.yiny.scrummer.ui.storyboard

import javax.swing.JFrame

public class PhasePanelBuilder extends ContainerBuilder {

    PhasePanelBuilder() {
        super('flowy')
    }

    static void main(args) {
        Random rand = new Random(System.currentTimeMillis())
        def strips = (1..3).collect {
            def cards = (1..(1 + rand.nextInt(5))).collect {
                new CardBuilder()
            }
            new PhaseStripBuilder(children: cards)
        }
        def builder = new PhasePanelBuilder(children: strips)
        def frame = new JFrame(title: 'Test')
        frame.with {
            defaultCloseOperation = EXIT_ON_CLOSE
            contentPane.add builder.initialise()
            strips.each {
                it.children.each {
                    it.name = 'name'
                    it.id = '#100'
                    it.description = 'description' * 6
                }
            }
            pack()
            visible = true
        }
    }
}